package cn.bjit.controller;


import cn.bjit.service.BannerService;
import cn.bjit.util.JsonData;
import cn.bjit.vo.BannerVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.boot.Banner;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.spring.web.json.Json;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/api/banner/v1")
public class BannerController {
    @Resource
    private BannerService bannerService;

    @ApiOperation("轮播图列表")
    @GetMapping("list")
    public JsonData list() {
        List<BannerVO> bannerList = bannerService.list();
        return JsonData.buildSuccess(bannerList);
    }
}

